#ifndef __COMMON_INPUT_MSG__
#define __COMMON_INPUT_MSG__

#include "board_config.h"
#include "common_def.h"

#include "sink_buttonmanager.h"

COM_TASK_EXTERN(InputMsg);

typedef struct
{
        uint32 key_val;
        uint8	 action;
}key_msg_t;
	
#define KEY_ACTION_DEF(key_val,action)	((key_val<<16)|action)

#define KEY_VAL_0	(8)
#define KEY_VAL_1	(4)
#define KEY_VAL_2	(2)
#define KEY_VAL_3	(1)

#define KEY_PWR		(KEY_VAL_3)
#define KEY_F		(KEY_VAL_0)
#define KEY_E		(KEY_VAL_1)
#define KEY_D		(KEY_VAL_2)

#define KX_PWR			KEY_ACTION_DEF(KEY_PWR,B_SHORT_SINGLE)
#define KD_PWR			KEY_ACTION_DEF(KEY_PWR,B_DOUBLE)
#define KL_PWR			KEY_ACTION_DEF(KEY_PWR,B_LONG)

#define KS_KEY_F			KEY_ACTION_DEF(KEY_F,B_SHORT_SINGLE)
#define KD_KEY_F			KEY_ACTION_DEF(KEY_F,B_DOUBLE)
#define KL_KEY_F			KEY_ACTION_DEF(KEY_F,B_LONG)

#define KS_KEY_E			KEY_ACTION_DEF(KEY_E,B_SHORT_SINGLE)
#define KD_KEY_E			KEY_ACTION_DEF(KEY_E,B_DOUBLE)
#define KL_KEY_E			KEY_ACTION_DEF(KEY_E,B_LONG)

#define KS_KEY_D			KEY_ACTION_DEF(KEY_D,B_SHORT_SINGLE)
#define KD_KEY_D			KEY_ACTION_DEF(KEY_D,B_DOUBLE)
#define KL_KEY_D			KEY_ACTION_DEF(KEY_D,B_LONG)

void common_input_message_init(void);

#endif  /*__COMMON_INPUT_MSG__*/
